<!doctype html>
<html class="no-js" lang="en">
<!--<![endif]-->
<head>
<meta name="layout" content="common">
<style>
select[name$="_month"]{
	width:auto;
}
select[name$="_year"]{
	width:auto;
}
select[name$="_day"]{
	width:auto;
}
</style>
<title>User Registration</title>
</head>
<body id="body">
  <h2>User Registration</h2>
  <hr />
  <g:if test="${flash.message}">
		<li>${flash.message}</li>
  </g:if>
  <!-- 
	<g:hasErrors bean="${userInstance}">
			<ul class="errors" role="alert">
				<g:eachError bean="${userInstance}" var="error">
				<li <g:if test="${error in org.springframework.validation.FieldError}">data-field-id="${error.field}"</g:if>><g:message error="${error}"/></li>
				</g:eachError>
			</ul>
	</g:hasErrors>
 -->
 <div class="row>">
  <g:form action="register">
    <table>
      <tbody>
        <tr>
          <td width="30%">Username&nbsp;<font color="red">*</font></td>
          <td><g:textField name="username" maxlength="18" value="${userInstance?.username}" />
          		<span class="errorMsg"><br/><g:fieldError bean="${userInstance}" field="username" /></span>
          </td>
        </tr>
        <tr>
          <td width="30%">Password&nbsp;<font color="red">*</font></td>
          <td><g:passwordField name="password" />
          </td>
        </tr>
        <tr>
          <td width="30%">Confirm Password&nbsp;<font color="red">*</font></td>
          <td><g:passwordField name="password2" />
          </td>
        </tr>
        <tr>
          <td width="30%">Name&nbsp;<font color="red">*</font></td>
          <td><g:textField name="name" maxlength="18"  value="${userInstance?.name}" />
          		<span class="errorMsg"><br/><g:fieldError bean="${userInstance}" field="name" /></span>
          </td>
        </tr>
        <tr>
          <td width="30%">Gender&nbsp;<font color="red">*</font></td>
          <td>
			<g:select name="gender" from="${['M', 'F']}" value="${userInstance?.gender}"/>
			<span class="errorMsg"><br/><g:fieldError bean="${userInstance}" field="gender"/></span>
		  </td>
        </tr>
        <tr>
          <td width="30%">Date of Birth:&nbsp;<font color="red">*</font></td>
          <td><g:datePicker name="birthDate" precision="day" default="${new java.text.SimpleDateFormat('yyyyMMdd').parse('19810101')}" relativeYears="[-70..15]"/>
              <span class="errorMsg"><br/><g:fieldError bean="${userInstance}" field="birthDate"/></span>
          </td>
        </tr>
        <tr>
          <td width="30%">Identity:&nbsp;<font color="red">*</font></td>
          <td><g:textField name="nric" maxlength="18" value="${userInstance?.nric}" />
          		<span class="errorMsg"><br/><g:fieldError bean="${userInstance}" field="nric" /></span>
          </td>
        </tr>
        <tr>
          <td width="30%">Email&nbsp;<font color="red">*</font></td>
          <td><g:textField name="email" maxlength="28" value="${userInstance?.email}" />
          		<span class="errorMsg"><br/><g:fieldError bean="${userInstance}" field="email" /></span>
          </td>
        </tr>
        <tr>
          <td width="30%">Mobile&nbsp;<font color="red">*</font></td>
          <td><g:textField name="mobile" maxlength="18"  value="${userInstance?.mobile}" />
          		<span class="errorMsg"><br/><g:fieldError bean="${userInstance}" field="mobile" /></span>
          </td>
        </tr>
        <tr>
          <td />
          <td><input type="submit" class="btn btn-primary" value="Submit" /></td>
        </tr>
      </tbody>
    </table>
  </g:form>
  </div>
</body>
</html>
